package com.feige.utils.file.pojo;

import com.github.tobato.fastdfs.domain.fdfs.MetaData;

import java.io.InputStream;
import java.util.Set;

/**
 * @author feige<br />
 * @ClassName: UploadInfo <br/>
 * @Description: <br/>
 * @date: 2021/9/25 17:56<br/>
 */
public class UploadInfo {

    private InputStream inputStream;
    private Long fileSize;
    private String fileName;
    private String originalFilename;
    private String fileType;
    private boolean enableDatePath;
    private Set<MetaData> metaDataSet;


    public InputStream getInputStream() {
        return inputStream;
    }

    public void setInputStream(InputStream inputStream) {
        this.inputStream = inputStream;
    }

    public Long getFileSize() {
        return fileSize;
    }

    public void setFileSize(Long fileSize) {
        this.fileSize = fileSize;
    }

    public String getFileName() {
        return fileName;
    }

    public String getFullFileName() {
        return fileName + "." + this.getFileExtName();
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getFileType() {
        return fileType;
    }

    public void setFileType(String fileType) {
        this.fileType = fileType;
    }

    public String getOriginalFilename() {
        return originalFilename;
    }

    public void setOriginalFilename(String originalFilename) {
        this.originalFilename = originalFilename;
    }

    public String getFileExtName() {
        int lastIndexOf = this.originalFilename.lastIndexOf('.');
        if (lastIndexOf != -1){
            return this.originalFilename.substring(lastIndexOf + 1);
        }
        return "";
    }


    public Set<MetaData> getMetaDataSet() {
        return metaDataSet;
    }

    public void setMetaDataSet(Set<MetaData> metaDataSet) {
        this.metaDataSet = metaDataSet;
    }

    public boolean isEnableDatePath() {
        return enableDatePath;
    }

    public void setEnableDatePath(boolean enableDatePath) {
        this.enableDatePath = enableDatePath;
    }
}
